package com.share.beta.chain.handler.impl;

import com.share.beta.chain.event.impl.CostEvent;
import com.share.beta.chain.event.impl.LogEvent;
import com.share.beta.chain.handler.AbstractCallHandler;
import org.springframework.stereotype.Component;

@Component
public class MockHandler extends AbstractCallHandler {

    /*构造诗进行初始化*/
    public MockHandler() {
        LogEvent logEvent = new LogEvent();
        CostEvent costEvent = new CostEvent();

        //设置链路关系
        logEvent.setNext(costEvent);


        //赋值给链路头
        event = logEvent;

        //设置类的属性
        type = "mock";
    }

    @Override
    public void call() {
        //1.直接接口调用

        //2.执行链路处理
        event.event();
    }
}
